User

interface User

This module provides methods to interact with and retrieve information about the connected user. Users can manage their presence, update personal information, retrieve contact suggestions, and perform various actions related to their account.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val userLoginInCache: String

Retrieves the user login stored in the cache, if available.

Link copied to clipboard
abstract val userPasswordInCache: String

Retrieves the user password stored in the cache, if available.

Link copied to clipboard
abstract val userTokenInCache: String

Retrieves the user token stored in the cache, if available. This token can be used with Connection.signInWithToken.

Functions

Link copied to clipboard
abstract fun changeUserPassword(oldPassword: String, newPassword: String, listener: RainbowListener<Unit, UserRepository.ChangePasswordError>? = null)

Changes the password of the logged-in user.

Link copied to clipboard
abstract fun deletePhoto(listener: RainbowListener<Unit, Unit>? = null)

Deletes the photo of the connected user.

Link copied to clipboard
abstract fun deleteUser(listener: RainbowListener<Unit, Unit>? = null)

Deletes the connected user. Be careful, you will not be able to use this account anymore.

Link copied to clipboard
abstract fun fetchCountries(listener: RainbowListener<List<Country>, Unit>? = null)

Retrieves the current list of Country objects supported by Rainbow.

Link copied to clipboard
abstract fun getAdvancedSuggestions(limit: Int, offset: Int, listener: RainbowListener<Map<ContactSuggestionType, List<IRainbowContact>>, Unit>? = null)

Retrieves company contact suggestions grouped by category. The callback returns a Map<ContactSuggestionType, List<IRainbowContact>>.

Link copied to clipboard
abstract fun getConnectedUser(): IRainbowContact

Retrieves the connected IRainbowContact object. If the user is not connected, an empty object is returned.

Link copied to clipboard
abstract fun getConnectedUserCustomData(): JSONObject

Retrieves the custom data of the connected user as a JSONObject.

Link copied to clipboard
abstract fun getConnectedUserProfiles(): List<Profile>

Retrieves the profiles of the connected user.

Link copied to clipboard
abstract fun getSuggestions(limit: Int = 50, listener: RainbowListener<List<IRainbowContact>, Unit>? = null)

Retrieves company contact suggestions. To retrieve more than 50 suggestions, use getAdvancedSuggestions with an offset parameter.

Link copied to clipboard
abstract fun getUserCompanyCustomData(): JSONObject

Retrieves the custom data of the connected user's company as a JSONObject.

Link copied to clipboard
abstract fun resetPassword(email: String?, newPassword: String?, token: String?, listener: RainbowListener<Unit, Unit>? = null)

Finalizes user password reinitialization. This method serves as the concluding step following the user password reinitialization initiated via startResetPassword.

Link copied to clipboard
abstract fun selfRegisterByEmail(email: String, lang: String? = null, listener: RainbowListener<Unit, Unit>? = null)

Facilitates user registration within the Rainbow environment, a two-step process:

Link copied to clipboard
abstract fun selfRegisterUser(body: SelfRegisterBody, listener: RainbowListener<IRainbowContact, Unit>? = null)

Finalizes a user's registration within the Rainbow environment. This method serves as the concluding step following the user registration initiation via selfRegisterByEmail.

Link copied to clipboard
abstract fun setPresenceTo(presence: RainbowPresence, listener: RainbowListener<Unit, Unit>? = null)

Changes the presence of the connected user.

Link copied to clipboard
abstract fun startResetPassword(email: String?, lang: String?, listener: RainbowListener<Unit, Unit>? = null)

Facilitates user password reinitialization, a two-step process:

Link copied to clipboard
abstract fun updatePhoto(photo: File, listener: RainbowListener<Unit, Unit>? = null)

Updates the photo of the connected user by providing a File object.

Link copied to clipboard
abstract fun updateUser(updateUserRequest: UpdateUserRequest, listener: RainbowListener<IRainbowContact, Unit>? = null)

Updates the connected user using the UpdateUserRequest.Builder for construction.